package dao;

import entity.TypeEntity;

import javax.persistence.EntityManager;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Calendar;

@WebServlet(name = "ServletTest",urlPatterns = "/test")
public class ServletTest extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        EntityManager em = (EntityManager) request.getAttribute("_entity.Manager");
        TypeEntity t = new TypeEntity();
        System.out.println("asdkasdl'a;sj;slkdj;zsd---------------");
        t.setName("susususu");
        em.persist(t);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
